# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=youki
pkgver=0.3.1
pkgrel=0
pkgdesc="Container runtime written in Rust"
url="https://github.com/containers/youki"
# ppc64le: syscalls crate inline asm is unstable for ppc64le
# s390x: nix crate lacks support
# riscv64: syscalls crate lacks support
# armv7: need for rustc to catch to up pass thumb-mode properly
arch="all !armv7 !ppc64le !s390x !riscv64"
license="Apache-2.0"
makedepends="
	cargo
	cargo-auditable
	dbus-dev
	libseccomp-dev
	zlib-dev
	"
subpackages="$pkgname-dbg"
source="https://github.com/containers/youki/archive/v$pkgver/youki-$pkgver.tar.gz"
options="!check" # FIXME: some tests fail

# prioritize crun and runc
provides="oci-runtime"
provider_priority=80

# Disable systemd_cgroups
_cargo_opts='--frozen --no-default-features --features=libcgroups/v1,libcgroups/v2'

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	install -D -m755 target/release/youki -t "$pkgdir"/usr/bin/
}

sha512sums="
6c73f406e1717c45a45d1beba2ceb26b9ffd965880f517b72aa4753504fd8e40f502aea6587429c17f6dcff3b5fda38ed496f0794f35bb65f003ece48be85e6c  youki-0.3.1.tar.gz
"
